package com.wxy.事务管理;

import org.springframework.jdbc.core.JdbcTemplate;

public class userDaoImpl implements userDao{

	private JdbcTemplate jdbcTemplate;
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	@Override
	public void update(String outUser,String inUser,int money) {
		// TODO 自动生成的方法存根
		this.jdbcTemplate.update
		("update bank set money=money-? where name=?",money,outUser);
		this.jdbcTemplate.update
		("update bank set money=money+? where name=?",money,inUser);
	}

}
